package com.opensso.client.ctrl;


import com.opensso.setting.entity.Setting;
import com.opensso.setting.service.SettingSV;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.core.Ordered;
import org.springframework.stereotype.Component;

import java.util.List;


@Component
//和下面的getOrder()一样的效果,二选一即可;
//@Order(value = 1)
public class VefifyAppRunner implements ApplicationRunner, Ordered {


    @Autowired
    private SettingSV settingSV;

    @Override
    public int getOrder() {
        return 1;//通过设置这里的数字来知道指定顺序
    }


    public void run(ApplicationArguments var1) throws Exception {
        System.out.println("VefifyAppRunner!");
        List<Setting> settings = settingSV.listAll();
        for (Setting setting : settings) {
            System.out.print(setting.getV() + "\n");
        }
    }

}
